import javax.swing.*;
import java.awt.*;

public class Start extends JFrame {
    private Login loginPanel = new Login(this);
    private Menu menuPanel = new Menu(this);
    private Deposit cun = new Deposit(this);
    private Take  que= new Take(this);
    private Check  cha= new Check(this);
    private Image bgImg = Util.getImage("/images/background.jpg");


    private CardLayout cardLayout = new CardLayout();
    public Start(){
        this.setContentPane(new JPanel(){
            @Override
            protected void paintComponent(Graphics g) {
                super.paintComponent(g);
                g.drawImage(bgImg,0,0,800,600,this);
            }
        });
        this.setLayout(cardLayout);
        this.add("login",loginPanel);
        this.add("menu",menuPanel);
        this.add("Cun",cun);
        this.add("Que",que);
        this.add("Cha",cha);
        this.setSize(800,600);
        this.setLocationRelativeTo(null);
        this.setDefaultCloseOperation(EXIT_ON_CLOSE);
        this.setVisible(true);
    }
    public void switchPanel(String name){
        cardLayout.show(this.getContentPane(),name);
    }

    public static void main(String[] args) {
        new Start();
    }
}

